package cn.qingyun.gis.modules.express.controller;


import cn.qingyun.gis.common.Result;
import cn.qingyun.gis.modules.express.service.IExpressRegionHandleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 快递业务规划数据（处理后） 前端控制器
 * </p>
 *
 * @author miyunguo
 * @since 2023-08-29
 */
@RestController
@RequestMapping("/app/express-region-handle")
public class ExpressRegionHandleController {
    @Resource
    private IExpressRegionHandleService iExpressRegionHandleService;

    @ApiOperation(value = "数据处理grid_new.csv")
    @GetMapping("/handleGridNewCsv")
    public Result<?> handleGridNewCsv(){
        iExpressRegionHandleService.wkt84To02();
        return Result.okData("正在处理grid_new.csv, 请稍后");
    }

    @ApiOperation(value = "根据grid_new.csv中边界绘制数据计算中心点")
    @GetMapping("/initCenter")
    public Result<?> initCenter(){
        iExpressRegionHandleService.initCenter();
        return Result.okData("正根据grid_new.csv中边界绘制数据计算中心点, 请稍后");
    }

    @ApiOperation(value = "导出grid_new.csv")
    @GetMapping("/downloadGridNewCsv")
    public void downloadGridNewCsv(){
        iExpressRegionHandleService.downloadGridNewCsv();
    }

    @ApiOperation(value = "将grid_new.csv边界绘制中经纬度精确到6位")
    @GetMapping("/handleGridNewCsv6")
    public Result<?> handleGridNewPointCsv6(){
        iExpressRegionHandleService.handleGridNewPointCsv6();
        return Result.okData("正在将grid_new.csv边界绘制中经纬度精确到6位, 请稍后");
    }

}
